package com.framework.workflow.params;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author zzg
 */
@Data
@ApiModel(value = "获取下一个任务节点配置需要的参数")
public class NodeSettingParam implements Serializable {
    @ApiModelProperty(value = "业务编号", required = true)
    private String businessId;

    @ApiModelProperty(value = "流程定义编号", required = true)
    private String procDefKey;

    @ApiModelProperty(value = "当前任务编号", notes = "如果不传，则为处理人为当前登录人，其所处节点的信息")
    private String  taskId;

    @ApiModelProperty(value = "其他参数")
    private Map<String,Object> attribute;

    public void addAll(Map<String,Object> attribute) {
        if (null == attribute) {
            attribute = new HashMap<>(16);
        }
        attribute.putAll(attribute);
    }

    public void addAttribute(String key, Object value) {
        if (null == attribute) {
            attribute = new HashMap<>(16);
        }
        attribute.put(key, value);
    }
}

